package com.flea.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @ResponseBody
    @GetMapping("/hello")
    public String hello(String name) {
        return "hello " + name;
    }

    @GetMapping("/hello2")
    public String hello2(Model model, String name) {
        model.addAttribute("name", name);
        return "index";
    }
}
